package me.shibor.study.servlet;

import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletContextAttributeListener;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * listener监听器
 * @author shibor
 *
 */
@WebListener
public class MyListener implements ServletContextListener,
									ServletContextAttributeListener,
									HttpSessionListener,
									ServletRequestListener{

    public MyListener() {

    }

    @Override
    public void contextInitialized(ServletContextEvent arg0) {
      
    	System.out.println("contextInitialized:...");
    }

    @Override
    public void contextDestroyed(ServletContextEvent arg0) {
       
    	System.out.println("contextDestroyed:...");
    }

	@Override
	public void attributeAdded(ServletContextAttributeEvent arg0) {
		
		System.out.println("attributeAdded...");
		
	}

	@Override
	public void attributeRemoved(ServletContextAttributeEvent arg0) {
		
		System.out.println("attributeRemoved...");
	}

	@Override
	public void attributeReplaced(ServletContextAttributeEvent arg0) {
		
		System.out.println("attributeReplaced...");
	}

	@Override
	public void sessionCreated(HttpSessionEvent arg0) {
		
		System.out.println("sessionCreated...");
		
	}

	@Override
	public void sessionDestroyed(HttpSessionEvent arg0) {
		
		System.out.println("sessionDestroyed...");
		
	}

	@Override
	public void requestDestroyed(ServletRequestEvent sre) {
		System.out.println("requestDestroyed...");
	}

	@Override
	public void requestInitialized(ServletRequestEvent sre) {
		System.out.println("requestInitialized...");
	}
	
}
